﻿@model Weapsy.Reporting.Languages.LanguageAdminModel

@{
    ViewBag.Title = "Edit Language";
}

@section scripts {
    @{ await Html.RenderPartialAsync("_ValidationScriptsPartial"); }
    <script src="~/js/admin/languages/shared.js"></script>
    <script src="~/js/admin/languages/edit.js"></script>
}

<div class="page-header">
    <h1>Edit Language</h1>
</div>

<form id="editLanguageForm" name="editLanguageForm" class="form-horizontal" role="form">
    <input type="hidden" id="id" name="id" value="@Model.Id" />

    @await Html.PartialAsync("_Language")

    <div class="form-group">
        <div class="col-md-offset-2 col-md-10">
            <button id="save" type="submit" class="btn btn-primary" title="Save">Save</button>
            @if (Model.Status == Weapsy.Domain.Languages.LanguageStatus.Hidden)
            {
                <a id="activateLanguage" class="btn btn-primary" title="Activate">Activate</a>
            }
            else if (Model.Status == Weapsy.Domain.Languages.LanguageStatus.Active)
            {
                <a id="hideLanguage" class="btn btn-primary" title="Hide">Hide</a>
            }
            <a id="deleteLanguage" class="btn btn-danger" data-toggle="modal" data-target="#confirm-delete" title="Delete">Delete</a>
            <a href="@Url.Action("Index", "Language", new { area = "Admin" })" class="btn btn-default" title="Cancel">Cancel</a>
        </div>
    </div>
</form>

@await Html.PartialAsync("_ConfirmDelete")

@*<table class="table">
    <thead>
        <tr>
            <th>Sequence</th>
            <th>Type</th>
            <th>Body</th>
            <th>TimeStamp</th>
        </tr>
    </thead>
    <tbody data-bind="foreach: events">
        <tr>
            <td data-bind="text: sequence"></td>
            <td data-bind="text: type"></td>
            <td data-bind="text: body"></td>
            <td data-bind="text: timeStamp"></td>
        </tr>
    </tbody>
</table>*@